Multiple granularity locking